﻿<%@ Page Title="Giỏ hàng" Language="C#" MasterPageFile="~/ExtendedPage.master" AutoEventWireup="true" CodeBehind="ShoppingCart.aspx.cs" Inherits="CuaHangLego.Webform.AddToCart" %>
<asp:Content ID="Content2" ContentPlaceHolderID="Products" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
    <asp:Label runat="server" Text="Giỏ hàng của bạn" Font-Size="X-Large" />
    <asp:Panel runat="server">
        <asp:Panel runat="server">
            <asp:Repeater runat="server" ID="CartProducts" OnItemDataBound="CartProducts_ItemDataBound">
                <HeaderTemplate>
                    <table class="CartTable">
                        <col style="width:50%">
                        <col style="width:15%">
                        <col style="width:15%">
                    <tr>
                        <td style="text-align:left">Mô tả sản phẩm</td>
                        <td style="text-align:right">Số lượng</td>
                        <td style="text-align:right">Đơn giá</td>
                        <td style="text-align:right">Thành tiền (VND)</td>
                    </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:Image ID="Image1" ImageUrl='<%# String.Format("img/{0}", DataBinder.Eval(Container.DataItem, "HinhAnh")) %>' CssClass="ProductImage" runat="server" meta:resourcekey="ImageResource1" />
                            <asp:Label ID="TenSP" runat="server" CssClass="ProductName" Text='<%# DataBinder.Eval(Container.DataItem, "Ten") %>' meta:resourcekey="TenSPResource1"/>
                        </td>
                        <td style="text-align:right">
                            <asp:DropDownList ID="SoLuongCbx" runat="server" AutoPostBack="true" DataSource="<%# this.lint %>" OnSelectedIndexChanged="SoLuongCbx_SelectedIndexChanged">
                            </asp:DropDownList></td>
                        <td style="text-align:right">
                            <asp:Label ID="GiaBan" runat="server" Text='<%# String.Format(System.Globalization.CultureInfo.CreateSpecificCulture("vi-VN"), "{0:n0}.000", (int)DataBinder.Eval(Container.DataItem, "GiaBan")) %>' meta:resourcekey="GiaBanResource1" />
                        </td>
                        <td style="text-align:right"><asp:Label ID="ThanhTien" runat="server" Text='<%# String.Format(System.Globalization.CultureInfo.CreateSpecificCulture("vi-VN"), "{0:n0}.000", 0) %>' /></td>
                        <asp:HiddenField runat="server" ID="ProductID" Value='<%# DataBinder.Eval(Container.DataItem, "MaSo") %>' />
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
            <asp:Panel runat="server" CssClass="TotalPrice">
                <table>
                    <col style="width:150px" />
                    <col style="width:150px" />
                    <tr>
                        <td>Tổng giá</td>
                        <td><asp:Label ID="TongGia" runat="server" Text="0" /></td>
                    </tr>
                    <tr>
                        <td>Phí vận chuyển</td>
                        <td><asp:Label ID="Label1" runat="server" Text="0" /></td>
                    </tr>
                    <tr>
                        <td>VAT</td>
                        <td><asp:Label ID="Label2" runat="server" Text="0" /></td>
                    </tr>
                    <tr>
                        <td colspan="2"><hr /></td>
                    </tr>
                    <tr class="textbold">
                        <td>Tổng hóa đơn</td>
                        <td><asp:Label ID="TongHoaDon" runat="server" Text="0" /></td>
                    </tr>
                    <tr class="textbold">
                        <td><asp:Button ID="RemoveCart" OnCommand="RemoveCart_Command" OnClientClick = "return confirm('Bạn có chắc chắn muốn xóa?');" runat="server" Text="XÓA GIỎ HÀNG" /></td>
                        <td><asp:Button ID="SubmitBuy" OnCommand="SubmitBuy_Command" runat="server" Text="MUA NGAY" /></td>
                    </tr>
                </table>
            </asp:Panel>
        </asp:Panel>
    </asp:Panel>

    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
